package com.zengqingfa.exercise.jvm;

/**
 * @author zengqingfa
 * @className ClassLoaderTest1
 * @description
 * @create 2021/10/19 18:22
 */
public class ClassLoaderTest1 {

    public static final int  count= 1; //静态变量赋一个默认值 int->0
    public static User user = new User(); //对象->null

    static {
        System.out.println("静态初始化");
    }

    public int calculate() {
        int x = 1;
        int y = 2;
        int z = x * y;
        return z;
    }

    public static void main(String[] args) {
        ClassLoaderTest1 loaderTest1 = new ClassLoaderTest1();
        ClassLoaderTest1 loaderTest2 = new ClassLoaderTest1();
        loaderTest1.calculate();
        loaderTest2.calculate();
    }
}